package com.pinganfu.tesla.iwallet;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.pinganfu.tesla.iwallet.session.SessionManager;
import com.pinganfu.tesla.iwallet.util.TeslaUtil;
import compinganfu.tesla.iwallet.widget.BaseActivity;

public class MyprofileActivity extends BaseActivity implements OnClickListener {

	private SessionManager mSessionMgr = SessionManager.getInstance();

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_myprofile);

		TextView tvRealName = (TextView) findViewById(R.id.tv_real_name);
		TextView tvAcctName = (TextView) findViewById(R.id.tv_acct_name);
		if (mSessionMgr.getUserPref() != null) {
			tvRealName.setText(mSessionMgr.getUserPref().getCertName());
			tvAcctName.setText(mSessionMgr.getUserPref().getMobileNo());
		}

		RelativeLayout layoutQr = (RelativeLayout) findViewById(R.id.layout_qr);
		layoutQr.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
			case R.id.layout_qr :
				TeslaUtil.gotoActivity(this, QrcodeActivity.class);
				break;
		}
	}
}
